-
Notifications
You must be signed in to change notification settings - Fork 678
Conversation
* add vX.x.x tag on release * merge master into develop after successful publish * add action to import TrufBot GPG keys for signed commits
ec42c83
to
ce7bab5
Compare
892c68f
to
0e9642f
Compare
Description
VC does two things.
RequirementsVC does not block the currently running application when it makes a request to check on the VC tracks the version that has been reported to the user to reduce its chattiness to the user. Upon start, VC will persist a On install, VC defaults the VC is specced to fail silently. If a request fails, returns invalid semver or any combination of current/latest version is not valid semver it will quit without informing the user. It is self-healing if the API incorrectly reports a version and is later corrected it will inform the user of the latest, correct, version. VC's relies on the same VC relies on the UsageVC is flexible in how it may be implemented const vc = new VersionCheck(currentVersionSemVer, [config], [logger]); The constructor requires a vc
.init();
.log();
await vc.getLatestVersion();
vc.log(); This usage will perform the the same steps as using vc.getVersionMessage();
TestFrom a develop environment, start ganache using: $ export VERSION="1.2.3"; npm run start Expected Output1.) No banner message is displayed (first run, assumes latest was installed) ~/proj/ganache (feat/version-check) » export VERSION="1.2.3"; npm run start hayek@rothbard
> root@ start /home/hayek/proj/ganache
> lerna exec --loglevel=silent --scope ganache -- npm run start --silent --
Debugger listening on ws://127.0.0.1:9229/b4dc2d61-8f90-4a2c-80ff-14db24160453
For help, see: https://nodejs.org/en/docs/inspector
ganache v1.2.3 (@ganache/cli: DEV, @ganache/core: DEV)
Starting RPC server 2.) A config file now exists for the user
Restart Expected Output
export VERSION="1.2.3"; npm run start hayek@rothbard
> root@ start /home/hayek/proj/ganache
> lerna exec --loglevel=silent --scope ganache -- npm run start --silent --
Debugger listening on ws://127.0.0.1:9229/911542db-3daa-433c-a31f-2aa662a084e2
For help, see: https://nodejs.org/en/docs/inspector
ganache v1.2.3 (@ganache/cli: DEV, @ganache/core: DEV)
Starting RPC server
╔══════════════════════════════════════════════════════════════════════╗
║ ║
║ New major version of ganache available! 1.2.3 ⇢ 7.0.5 ║
║ Changelog: https://github.com/trufflesuite/ganache/releases/v7.0.5 ║
║ Run npm install -g [email protected] to update! ║
║ ║
╚══════════════════════════════════════════════════════════════════════╝
{
"config": {
"packageName": "ganache",
"enabled": true,
"url": "https://version.trufflesuite.com/",
"ttl": 300,
"latestVersion": "7.0.5",
"latestVersionLogged": "7.0.5"
}
} Restart Expected Results1.) Banner message does not display, user has already seen this version. export VERSION="1.2.3"; npm run start 130 ↵ hayek@rothbard
> root@ start /home/hayek/proj/ganache
> lerna exec --loglevel=silent --scope ganache -- npm run start --silent --
Debugger listening on ws://127.0.0.1:9229/27f051e4-1c84-4bdf-a41d-95601466ba2b
For help, see: https://nodejs.org/en/docs/inspector
ganache v1.2.3 (@ganache/cli: DEV, @ganache/core: DEV)
Starting RPC server Run Expected Resultganache v1.2.3 (@ganache/cli: DEV, @ganache/core: DEV)
note: there is a new version available! 1.2.3 -> 7.0.5 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work! And you did an awesome job documenting this stuff.
In addition to my comments, there's one issue I noticed when testing. I'm getting this error in the console when testing in VS Code:
Starting inspector on 127.0.0.1:9229 failed: address already in use
It happens when I run ganache more than once in a row. It looks like the VS code inspector is being held open. Maybe by the request for the version number?
I don't know for sure what the cause is, but I switched to develop and rebuilt and the issue does not occur over there, so I think it was introduced with this change.
Co-authored-by: Micaiah Reid <[email protected]>
@MicaiahReid Super Sleuthing catching the multiple instances bug. I was able to reproduce and troubleshoot. Looks like it was where I had This should be ready for the next pass. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome work @tenthirtyone! Tested and everything seems to be working great.
No description provided.